﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using IMCOM.Imagiality.Core;

namespace IMCOM.Imagiality.ImageProcessing.Canvas2D.Commands
{
    public class CropCommand : CanvasImageCommand
    {
        private Rectangle regionOfInterest;

        public Rectangle RegionOfInterest
        {
            get { return regionOfInterest; }
            set { regionOfInterest = value; }
        }

        public CropCommand(Rectangle regionOfInterest)
        {
            RegionOfInterest = regionOfInterest;
        }

        public void Execute(CanvasImageWrapper canvasImageWrapper)
        {
            foreach (GenericImage image in canvasImageWrapper.OriginalImages)
            {
                image.RegionOfInterest = RegionOfInterest;
            }
        }
    }
}
